package com.example.healthmanagement.service;


import com.example.healthmanagement.dao.BmiRepository;
import com.example.healthmanagement.entity.Bmi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BmiService {


    BmiRepository bmiRepository;


    @Autowired
    public BmiService(BmiRepository bmiRepository) {
        this.bmiRepository = bmiRepository;
    }

    public List<Bmi> findAll() {
        return bmiRepository.findAll();
    }

    public Bmi getByValue(double bmi) {
        return bmiRepository.findBmiByValue(bmi);
    }
}
